<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<head>
<!-- Copyright 1997 The Open Group, All Rights Reserved -->
<title>setpgrp</title>
</head><body bgcolor=white>
<center>
<font size=2>
The Single UNIX &reg; Specification, Version 2<br>
Copyright &copy; 1997 The Open Group

</font></center><hr size=2 noshade>
<h4><a name = "tag_000_008_456">&nbsp;</a>NAME</h4><blockquote>
setpgrp - set process group ID
</blockquote><h4><a name = "tag_000_008_457">&nbsp;</a>SYNOPSIS</h4><blockquote>
<pre><code>

#include &lt;<a href="unistd.h.html">unistd.h</a>&gt;

pid_t setpgrp(void);
</code>
</pre>
</blockquote><h4><a name = "tag_000_008_458">&nbsp;</a>DESCRIPTION</h4><blockquote>
If the calling process is not already a session leader,
<i>setpgrp()</i>
sets the process group ID of the calling process to the process ID of the
calling process.  If
<i>setpgrp()</i>
creates a new session, then the new session has no controlling terminal.
<p>
The
<i>setpgrp()</i>
function has no effect when the calling process is a session leader.
</blockquote><h4><a name = "tag_000_008_459">&nbsp;</a>RETURN VALUE</h4><blockquote>
Upon completion,
<i>setpgrp()</i>
returns the process group ID.
</blockquote><h4><a name = "tag_000_008_460">&nbsp;</a>ERRORS</h4><blockquote>
No errors are defined.
</blockquote><h4><a name = "tag_000_008_461">&nbsp;</a>EXAMPLES</h4><blockquote>
None.
</blockquote><h4><a name = "tag_000_008_462">&nbsp;</a>APPLICATION USAGE</h4><blockquote>
None.
</blockquote><h4><a name = "tag_000_008_463">&nbsp;</a>FUTURE DIRECTIONS</h4><blockquote>
None.
</blockquote><h4><a name = "tag_000_008_464">&nbsp;</a>SEE ALSO</h4><blockquote>
<i><a href="exec.html">exec</a></i>,
<i><a href="fork.html">fork()</a></i>,
<i><a href="getpid.html">getpid()</a></i>,
<i><a href="getsid.html">getsid()</a></i>,
<i><a href="kill.html">kill()</a></i>,
<i><a href="setsid.html">setsid()</a></i>,
<i><a href="unistd.h.html">&lt;unistd.h&gt;</a></i>.
</blockquote><hr size=2 noshade>
<center><font size=2>
UNIX &reg; is a registered Trademark of The Open Group.<br>
Copyright &copy; 1997 The Open Group
<br> [ <a href="../index.html">Main Index</a> | <a href="../xshix.html">XSH</a> | <a href="../xcuix.html">XCU</a> | <a href="../xbdix.html">XBD</a> | <a href="../cursesix.html">XCURSES</a> | <a href="../xnsix.html">XNS</a> ]

</font></center><hr size=2 noshade>
</body></html>
